package com.example.blockbreaker;

import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.PrimaryKey;

@Entity(tableName = "health_data")
public class HealthData {
    @PrimaryKey(autoGenerate = true)
    public int id;

    @ColumnInfo(name = "timestamp")
    public long timestamp;

    @ColumnInfo(name = "heart_rate")
    public int heartRate;

    @ColumnInfo(name = "oxygen_level")
    public int oxygenLevel;

    @ColumnInfo(name = "energy_level")
    public int energyLevel; // 1-10

    @ColumnInfo(name = "cravings_intensity")
    public int cravingsIntensity; // 1-10

    private int cravingIntensity;

    public HealthData(long timestamp, Integer heartRate, Integer oxygenLevel,
                      int energyLevel, int cravingIntensity) {
        this.timestamp = timestamp;
        this.heartRate = heartRate;
        this.oxygenLevel = oxygenLevel;
        this.energyLevel = energyLevel;
        this.cravingIntensity = cravingIntensity;
    }

    // Getter 方法
    public int getId() { return id; }
    public long getTimestamp() { return timestamp; }
    public Integer getHeartRate() { return heartRate; }
    public Integer getOxygenLevel() { return oxygenLevel; }
    public int getEnergyLevel() { return energyLevel; }
    public int getCravingIntensity() { return cravingIntensity; }

    // Setter for Room
    public void setId(int id) { this.id = id; }
}